Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update field docstring to reflect "attribute" argument affecting deserialization #2166

Closed

Conversation

MikeElahi
Copy link

I believe this simple change should resolve the documentation ambiguity in #2145. However, I'm a first-time contributor so please let me know if an explanation here would be better.

Also, should I perhaps open a PR following this to reflect the data_key condition?

@lafrech
Copy link
Member

lafrech commented Aug 15, 2023

Thanks for contributing.

I just pushed a commit in dev with a phrasing that I find more explicit.

    :param data_key: The name of the dict key in the external representation, i.e.
        the input of `load` and the output of `dump`.
        If `None`, the key will match the name of the field.
    :param attribute: The name of the key/attribute in the internal representation, i.e.
        the output of `load` and the input of `dump`.
        If `None`, the key/attribute will match the name of the field.
        Note: This should only be used for very specific use cases such as
        outputting multiple fields for a single attribute, or using keys/attributes
        that are invalid variable names, unsuitable for field names. In most cases,
        you should use ``data_key`` instead.

@lafrech lafrech closed this Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants